import config from './config'

export default (url , method='GET') => {
    return new Promise((resolve, reject) => {
        wx.request({
          url: config.host + url,
          method,
          success: (res) => {
            resolve(res.data);
          }, 
          fail: (err) => {
            reject(err);
          }
        })
    })
}